set inten on
STORE 0 TO CNT,CR
play=savescreen(0,0,24,79)
sele 1
set exclu off
use &dr&F1 inde &dr&F11
seek ALLTRIM(kunci)
if .not. eof()
   DO WHILE left(COMP_CODE,len(kunci))=alltrim(kunci)
      cnt=cnt+1
      compcode=comp_code
      DO WHILE left(COMP_CODE,len(kunci))=alltrim(compcode)
         skip
      enddo
   ENDDO
   IF CNT=0 .or. lastkey()=27
      RETURN
   ENDIF
   DECLARE FILD[CNT]
   DECLARE comcd[CNT]
   DECLARE CNAM[CNT]
   SELE 1
   seek ALLTRIM(kunci)
   if .not. eof()
      DO WHILE left(COMP_CODE,len(kunci))=alltrim(kunci)
         cr=cr+1
         nm=alltrim(CLIENT)+' '+alltrim(comp_code)
         FILD[CR]=nm
         comcd[CR]=comp_CODE
         CNAM[CR]=CLIENT
         compcode=comp_code
         DO WHILE left(COMP_CODE,len(kunci))=alltrim(compcode)
            skip
         enddo
      ENDDO
   endif
   set colo to w/b
   inkey()
   set colo to w+/rb,gr+/r
   @ 15,3 clea to 23,75
   @ 15,3 to 23,75 double
   pilih=achoice(16,5,22,73,FILD)
   IF LASTKEY()=13
      DARF=FILD[PILIH]
      compcod=comcd[PILIH]
      name=CNAM[PILIH]
   else
      restscreen(0,0,24,79,play)
*      close database
*      close index
*      set color to n/bg/w+/n
      return
   ENDIF
else
   name=space(32)
endif 
return